#!/bin/bash

# 替换阿里云镜像源
sed -i.bak -e 's|^mirrorlist=|#mirrorlist=|g' \
          -e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.aliyun.com/rockylinux|g' \
          /etc/yum.repos.d/rocky*.repo

# 清理缓存并重建
dnf clean all
dnf makecache
